package com.awt.layoutManager;

import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;

/**
 * @authoer zsj
 * @date 2023/4/15 13:39
 */
public class BoxLayout {

    public static void main(String[] args) {
        Frame frame = new Frame();

        //创建水平怕排列box容器
        Box hbox = Box.createHorizontalBox();
        hbox.add(new Button("b1"));
        hbox.add(new Button("b2"));

        Box vbox = Box.createVerticalBox();
        vbox.add(new Button("b3"));
        vbox.add(new Button("b4"));


        frame.add(hbox, BorderLayout.NORTH);
        frame.add(vbox,BorderLayout.CENTER);


        frame.pack();
        frame.setVisible(true);
    }
}
